<template>
  <div class="statistics3-container">
    <div class="query-container">
      <el-form :inline="true" class="demo-form-inline">
        <el-form-item label="报表">
          <el-select v-model="query.dateType" @change="dateTypeChange">
            <el-option label="月报" value="DAY"></el-option>
            <el-option label="年报" value="MONTH"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="日期">
          <el-date-picker
            v-if="query.dateType === 'DAY'"
            v-model="query.date"
            type="month"
            format="yyyy-MM"
            value-format="yyyy-MM"
            placeholder="选择月份"
          ></el-date-picker>
          <el-date-picker
            v-if="query.dateType === 'MONTH'"
            v-model="query.date"
            type="year"
            format="yyyy"
            value-format="yyyy"
            placeholder="选择年份"
          ></el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="queryClick">查询</el-button>
          <el-button type="success" @click="exportClick">导出</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      query: {
        dateType: 'MONTH'
      }
    }
  },
  mounted () {
    this.getList()
  },
  methods: {
    async getList () {
      const result = await this.$fetchGet('/power/systemIndicators/MONTH/2020')
      console.log(result)
    },
    dateTypeChange () {},
    queryClick () {},
    exportClick () {}
  }
};
</script>

<style lang="less">
.statistics3-container {
  padding: 50px;
}
</style>